-
Notifications
You must be signed in to change notification settings - Fork 820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: prometheus serializer #1310
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1310 +/- ##
==========================================
+ Coverage 93.80% 93.91% +0.10%
==========================================
Files 149 151 +2
Lines 4539 4615 +76
Branches 940 953 +13
==========================================
+ Hits 4258 4334 +76
Misses 281 281
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overal lgtm, nit pick about comparison
packages/opentelemetry-exporter-prometheus/src/PrometheusLabelsBatcher.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-exporter-prometheus/src/PrometheusSerializer.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I think you are changing here too many things at the same time.
- The serializer itself is not spec compliant
- The changes to metrics should be done first in separate PR, after that PR you can focus on serialisation only .
packages/opentelemetry-exporter-prometheus/src/PrometheusLabelsBatcher.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-exporter-prometheus/src/PrometheusSerializer.ts
Outdated
Show resolved
Hide resolved
packages/opentelemetry-exporter-prometheus/src/PrometheusSerializer.ts
Outdated
Show resolved
Hide resolved
# Conflicts: # packages/opentelemetry-exporter-prometheus/package.json # packages/opentelemetry-metrics/src/export/aggregators/Histogram.ts
@obecny have your concerns here been addressed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
last concern with the batcher - added comment
packages/opentelemetry-exporter-prometheus/test/PrometheusLabelsBatcher.test.ts
Show resolved
Hide resolved
# Conflicts: # packages/opentelemetry-exporter-prometheus/src/prometheus.ts
#1428 added mapping |
Choosing the aggregation based on metric type might be wrong. The user can use the same metric and create its own batcher and use different aggregators for the same metrics. Also due to last conversation on spec we will have to change ValueObserver aggregator and ValueRecorder again so to avoid any such problems in future we should only depends on aggregator type and never on metric type when trying to get the value (btw MinMaxLastSumCountAggregator will be removed completely) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This looks ok to me, but I want to mention that this looks like it does a lot more than just the serialization. In the future, I would appreciate if you would break out other work into separate PRs because it makes it very difficult to review when the PR is so large. I am also concerned that many of the largest changes seem to have come after the first round of reviews, which means the approvals it already had were for code that is very different than the current state. I am not going to block this PR, but please keep these things in mind for future PRs. |
Thanks for the reviews! :D |
Co-authored-by: Daniel Dyla <[email protected]>
Co-authored-by: Daniel Dyla <[email protected]>
Which problem is this PR solving?
Short description of the changes
PrometheusSerializer
to serialize aggregated metric records.PrometheusLabelsBatcher
to aggregate metric records with different labels.prom-client
.